#include<iostream>
using namespace std;
int arr[7] = { 1, 2, 3, 4, 5, 6, 7 };
int binarysearch( int num)
{
	int ans = -1;
	int left = 0;
	int right = 6;
	while (left <= right)
	{
		int mid = (right + left) / 2;
		if (arr[mid] == num)
		{
			ans = mid;
			break;
		}
		else if (arr[mid] > num)
			right = mid-1;
		else
			left = mid+1;
	}
	return ans;
}
int main()
{
	int i = 1;
	for (i; i <= 10; i++)
	{
		cout << binarysearch(i) << endl;
	}
}